import React, {Component } from 'react';

import { withRouter,NavLink,Switch,Redirect,Route} from 'react-router-dom';

import {connect} from 'react-redux';

class View extends Component{
    render(){
        const {isList} = this.props;
        const list = isList.map((val,key)=>{
            return(
                <li key={key}>
                    <span>{val.text}</span>
                </li>
            )
        })

        return(
            <div className="m">
                <h3>第二个页面</h3>
                <NavLink to="/">这是首页</NavLink><br/>
                {/*<NavLink to="/filter">filter</NavLink><br/>
                <NavLink to="/add">add</NavLink><br/>
                <NavLink to="/newaction">newaction</NavLink><br/>*/}
                <NavLink to="/action">action</NavLink><br/>
                <NavLink to="/action2">action2</NavLink><br/>
                <ul>{list}</ul>
            </div>
        )
    }
}
function mapStateToProps(state) {
  return {
      isList:state.add
  }
}
export default connect(mapStateToProps,null)(View);
